package rpg.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;

public final class Close {
    public static IOException andReturnException(InputStream x) {
        try {
            if (x != null) {
                x.close();
            }
            return null;
        }
        catch (IOException e) {
            return e;
        }
    }

    public static IOException andReturnException(Reader x) {
        try {
            if (x != null) {
                x.close();
            }
            return null;
        }
        catch (IOException e) {
            return e;
        }
    }

    private Close() {
        super();
    }
}
